<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Habilitar Cajas</title>
    </h:head>
    <h:body>
        <p:growl life="5000" showDetail="true" showSummary="true"/>
        <h:form id="formulario">
            <p:panelGrid columns="2">
                <p:outputLabel value="Cajero"/>
                <p:outputLabel value="#{gestionarCajas.cajero}">
                </p:outputLabel>
                <p:outputLabel value="Caja"/>
                <p:selectOneMenu id="nroCaja" value="#{gestionarCajas.caja}" required="true" requiredMessage="Elija la caja" >
                    <f:selectItem itemLabel="Seleccione una caja"/>
                    <f:selectItems value="#{cajasController.items}"
                                   var="nroCajaItem"
                                   itemValue="#{nroCajaItem}"
                                   itemLabel="#{nroCajaItem.descripcion.toString()}"
                                   />
                    <f:converter binding="#{cajasConverter}"/>
                </p:selectOneMenu>
                <p:outputLabel value="Saldo inicial"/>
                <p:inputText value="#{gestionarCajas.saldoInicial}" required="true" requiredMessage="Debe ingresar saldo inicial"/>
                <p:commandButton value="Habilitar caja" actionListener="#{gestionarCajas.habilitarCaja()}" ajax="false"  update="formulario"/>
            </p:panelGrid>
        </h:form>
    </h:body>
</html>

